This week you will learn how to:
Since this is a visualisation unit, we will be using and examining many different images – and you will need to submit some in your Problem Solving Tasks and Projects. There are two types of images we will be using, and each is added to an R markdown document differently. - Most frequently, we will be making new visualisations using R commands and raw datasets. To make these images, we will add code chunks to the R markdown documents that generate the figures. That way, the visualisation is created when we knit the R markdown document. - Sometimes, including this week, we will need to refer to and examine existing images from other sources. These need to be added to the R markdown documents. Use the line of code {width=some percentage of the text width from 0 to 100} to embed images within the R markdown document. This does not need to be added within a code chunk.
For example, the command {width=75%} prints one of my favourite visualisations a student found in a previous year in this Problem Solving Task, which is being pulled from the reddit website
To find the URL of an image online, right click on the image and select “Coppy Image Address”.
To add an image from your computer instead, replace the URL with a file path. If you choose to do this, please make sure you’re submitting the image file along with your code and your knitted version.
In this week’s lecture you learnt about:
Genres of Narrative Visualisation (Segel, 2010). Source: https://www.mdpi.com/2078-2489/9/3/65/htm
Your Problem Solving task this week will be to create a few storyboards for different visualisations (including one you need to find yourself!).
We’re going to run you through a couple of examples first, which use the information you learned in the lecture this week.
Title & Link: How fast emissions would reduce if other plans were adopted – take a look at the link, it is a graphic that builds on itself to give context.
Image: This is just a static screenshot of an animated visualisation, which you will need to include if you use any animated visualisations. Please click through to see the whole animation before exploring the storyboard below.
How fast emissions would reduce if other plans were adopted. Sourced from: https://i1.wp.com/flowingdata.com/wp-content/uploads/2019/02/Cut-U.S.-emissions.png?w=2048&ssl=1
Who is the audience or audiences?:
Educated readers from the general public (i.e. not necessarily policy-makers or scientists) who are informed about the climate crisis, and agree with the goal to reduce emissions.
What is the action the visualisation is aiming for? Consider each audience here if you have multiple:
When can the communication happen, and what tools have been used to suggest an order:
Animated image allows multple shots at communication to build the graphic. In each static graphic, multiple factors have been used to suggest order: colour, line angle, colour intensity, and enclosure.
How has the data been used to convey the action?:
Line plot of current emissions, compared with line plot of projected emissions if zero-carbon energy sources were used, compared with the national goal in red. Text labelling has been used.
Which of the seven genres listed above best describes the data visualisation?
Slide show.
We will work progressively through this one together. This is not a marked exercise, but I suggest you think about your answers to practice before revealing some suggested answers by hovering your mouse over the text. Thinking back to the Leonardo DiCaprio visualisation,
Who is the audience or audiences?:
"What is the action the visualisation is aiming for? Consider each audience here if you have multiple:
When can the communication happen, and what tools have been used to suggest an order:
How has the data been used to convey the action?:
Which of the seven genres listed above best describes the data visualisation?:
Task 1: Use these principles of narration and stort-telling to back-engineer ONE story boards with all of the elements above from the list of visualisations below. This will contribute to your Problem Solving Task for submission.
Visualisation Title & Link:
Image:
If you’re grabbing this from the internet, make sure you right click on the image and select (‘Copy image address’). If it’s an animation, you’ll need to take a screenshot and embed that filepath here. Please include all images in your submission.
Who is the audience or audiences?:
What is the action the visualisation is aiming for? Consider each audience here:
When can the communication happen, and what tools have been used to suggest an order:
How has the data been used to convey the action?:
Which of the seven genres listed above best dsecribes the data visualisation?
- Work through Chapters 4 (short) and 5 of R for Data Science. Read and follow all the examples along in your own R console for:
You can go back to the exercises you skipped outside of class time, although they aren’t critical at this stage of the unit.
Reminder: You may want to just play around in R and get things to work before copying them into R markdown files for your PST. To do this, or to follow along these examples in the textbook, you can type straight into the Console. That is quick and easy, but doesn’t let you save your code. You’ll need to load the libraries we need into the Console in that case.
If you want to save R code but don’t necessarily want it in the .Rmd file for your assessment, click File > New file > R script, and you can type away in there – and save it as a separate file (similar to an m file in matlab). To run code from an R file, highlight the section you want to run and click ‘Run’ above, or just copy paste it into the console. That way you can edit multiple lines at once, and save the whole script. This is a really useful option for keeping useful commends from these workshops all in one place. At the beginning of each R script, it is good practice to add the library() lines that load the packages you need – you will thank yourself later!
Remember that if you get an error when you try to load a package, you might not have installed it on that computer yet. install.packages("package_name_that_you_want_to_use_goes_here_dont_forget_the_quotation_marks_every_beginner_does") is your trusty command to install the packages you need.